﻿<UserControl x:Class="Net.Chirash.Twitter.TweetZone.WindowComponents.RateLimitPresenter"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:tc="clr-namespace:Net.Chirash.Twitter.TwitterClient;assembly=TwitterClient"
             mc:Ignorable="d" 
             d:DesignHeight="30" d:DesignWidth="30"
             Loaded="UserControl_Loaded"
             x:Name="root">
    <UserControl.Resources>
        <tc:RateLimit x:Key="RateLimitData" />
    </UserControl.Resources>
    <Border BorderBrush="{StaticResource WhiteBrush}" BorderThickness="1">
    <Grid DataContext="{DynamicResource RateLimitData}"
          DataContextChanged="Grid_DataContextChanged"
          SizeChanged="grid_SizeChanged"
          x:Name="grid">
        <Grid.ToolTip>
            <StackPanel>
                <Label Content="{Binding ResetTime}" />
            </StackPanel>
        </Grid.ToolTip>
        <Rectangle x:Name="rect" Fill="{StaticResource SkyBlueBrush}" Width="0" HorizontalAlignment="Left" />
        <StackPanel Margin="4,0,4,0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
            <TextBlock Text="{Binding RemainingHits}"></TextBlock>
            <TextBlock Text="/" />
            <TextBlock Text="{Binding HourlyLimit}"></TextBlock>
        </StackPanel>
    </Grid>
        
    </Border>
</UserControl>
